n = int(input())
v = []
a = 0
for i in range(n):
v.append(list(map(int, input().split())))
if n <= 1:
print(-1)
else:
if n == 2:
if v[0][0] == v[1][0] or v[0][1] == v[1][1]:
print(-1)
else:
a = abs(v[0][0] - v[1][0])*abs(v[0][1] - v[1][1])
print(a)
elif n == 3:
if v[0][0] != v[1][0] and v[0][1] != v[1][1]:
a = abs(v[0][0] - v[1][0])*abs(v[0][1] - v[1][1])
print(a)
elif v[0][0] != v[2][0] and v[0][1] != v[2][1]:
a = abs(v[0][0] - v[2][0])*abs(v[0][1] - v[2][1])
print(a)
else:
a = abs(v[2][0] - v[1][0])*abs(v[2][1] - v[1][1])
print(a)
else:
if v[0][0] != v[1][0] and v[0][1] != v[1][1]:
a = abs(v[0][0] - v[1][0])*abs(v[0][1] - v[1][1])
print(a)
elif v[0][0] != v[2][0] and v[0][1] != v[2][1]:
a = abs(v[0][0] - v[2][0])*abs(v[0][1] - v[2][1])
print(a)
else:
a = abs(v[0][0] - v[3][0])*abs(v[0][1] - v[3][1])
print(a)
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
// const int maxn = ;
int value(set<int> &s){
return *s.begin() - *s.rbegin();
}
int main()
{
int n;
cin >> n;
set<int> a;
set<int> b;
for (int i = 1; i <= n; i++) {
int aa, bb;
cin >> aa >> bb;
a.insert(aa);
b.insert(bb);
}
if (a.size() < 2 || b.size() < 2) {
cout << -1;
}
else {
cout << value(a) * value(b) << endl;
}
return 0;
}
7A - Kalevitch and Chess | 912B - New Year's Eve |
1537C - Challenging Cliffs | 879B - Table Tennis |
1674E - Breaking the Wall | 1282A - Temporarily unavailable |
1366C - Palindromic Paths | 336A - Vasily the Bear and Triangle |
926A - 2-3-numbers | 276D - Little Girl and Maximum XOR |
1253C - Sweets Eating | 1047A - Little C Loves 3 I |
758D - Ability To Convert | 733A - Grasshopper And the String |
216A - Tiling with Hexagons | 1351B - Square |
1225A - Forgetting Things | 1717A - Madoka and Strange Thoughts |
1717B - Madoka and Underground Competitions | 61B - Hard Work |
959B - Mahmoud and Ehab and the message | 802G - Fake News (easy) |
1717C - Madoka and Formal Statement | 420A - Start Up |
1031A - Golden Plate | 1559C - Mocha and Hiking |
427B - Prison Transfer | 330A - Cakeminator |
426A - Sereja and Mugs | 363A - Soroban |